package com.woniuxy.woniuhis.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.woniuxy.woniuhis.entity.Log;
import com.woniuxy.woniuhis.exception.LogServiceException;
import com.woniuxy.woniuhis.mapper.LogMapper;
import com.woniuxy.woniuhis.service.LogService;

/***
 * 系统日志ServiceImpl
 */
@Service
public class LogServiceImpl implements LogService{
	
	@Autowired
	LogMapper logMapper;

	@Override
	public int deleteByPrimaryKey(Long id) {
		try {
			return logMapper.deleteByPrimaryKey(id);
		} catch (Exception e) {
			throw new LogServiceException(e);
		}
	}

	@Override
	public int insert(Log record) {
		try {
			return logMapper.insert(record);
		} catch (Exception e) {
			throw new LogServiceException(e);
		}
	}

	@Override
	public int insertSelective(Log record) {
		try {
			return logMapper.insertSelective(record);
		} catch (Exception e) {
			throw new LogServiceException(e);
		}
	}

	@Override
	public Log selectByPrimaryKey(Long id) {
		try {
			return logMapper.selectByPrimaryKey(id);
		} catch (Exception e) {
			throw new LogServiceException(e);
		}
	}

	@Override
	public int updateByPrimaryKeySelective(Log record) {
		try {
			return logMapper.updateByPrimaryKeySelective(record);
		} catch (Exception e) {
			throw new LogServiceException(e);
		}
	}

	@Override
	public int updateByPrimaryKey(Log record) {
		try {
			return logMapper.updateByPrimaryKey(record);
		} catch (Exception e) {
			throw new LogServiceException(e);
		}
	}

	@Override
	public int deleteLogByDate(Date time) {
		try {
			return logMapper.deleteLogByDate(time);
		} catch (Exception e) {
			throw new LogServiceException(e);
		}
	}

}
